
#include <avr/io.h>
#include <avr/pgmspace.h>

#define LED_DDR  DDRD
#define LED_PORT PORTD


void delay50ms(unsigned int cnt){
	while(cnt--){
		unsigned char i,j;
		for(i=0; i<255; i++){
			for(j=0; j<10; j++){
			asm("nop");
			asm("nop");
			asm("nop");
			}
		}
	}

}
int main(void)
{
	signed char  i,j;
	unsigned char k,temp=0;
	LED_DDR=0XFF;

	while(1)
	{
		for(i=7;i>=0;i--)
		{
		    k=0x01;
			for(j=i;j>=0;j--)
			{
			 LED_PORT = temp|k;
			 delay50ms(200);
			 k<<=1;
			}
			 temp = LED_PORT;
		}
	}
	return 1;
}
